package net.googlecode.morenko.task3;

/**
 * The main class.
 */
public class SalaryApp {
    /**
     * Creates manager without bonus.
     * @return reference on manager object.
     */
    public static Manager createManagerWithoutBonus() {
        Manager manager = new Manager("Ivan", "Ivanov");
        manager.setAge(30);
        manager.setPerHour(true);
        manager.setBonus(false);
        manager.setRate(25);
        manager.setTax(250);
        return manager;
    }

    /**
     * Creates manager with bonus.
     * @return reference on manager object.
     */
    public static Manager createManagerWithBonus() {
        Manager manager = new Manager("Petr", "Petrov");
        manager.setAge(35);
        manager.setBonus(true);
        manager.setBonusAmT(1000);
        manager.setPerHour(false);
        manager.setRate(5000);
        manager.setTax(250);
        return manager;
    }

    /**
     * Creates employee with bonus.
     * @return reference on employee object.
     */
    public static Employee createEmployeeWithBonus() {
        Employee employee = new Employee("Semen", "Semenov");
        employee.setAge(55);
        employee.setBonus(true);
        employee.setBonusAmT(1500);
        employee.setPerHour(true);
        employee.setRate(8);
        employee.setExperience(10);
        employee.setTax(125);
        return employee;
    }

    /**
     * Creates employee without bonus.
     * @return reference on employee object.
     */
    public static Employee createEmployeeWithoutBonus() {
        Employee employee = new Employee("Sergey", "Sergeev");
        employee.setAge(45);
        employee.setBonus(true);
        employee.setPerHour(false);
        employee.setExperience(15);
        employee.setRate(200);
        employee.setTax(125);
        return employee;
    }

    /**
     * Creates director.
     * @return reference on director object.
     */
    public static Director createDirector() {
        Director director = new Director("Pankrat", "Pankratovich");
        director.setAge(55);
        director.setBonusAmT(2000);
        director.setRate(35);
        director.setTax(500);
        return director;
    }

    /**
     * The main function of the program.
     * @param args command line arguments.
     */
    public static void main(String[] args) {
        SalaryCalculator cal = new SalaryCalculator();
        cal.calc(createManagerWithoutBonus());
        cal.calc(createManagerWithBonus());
        cal.calc(createEmployeeWithBonus());
        cal.calc(createEmployeeWithoutBonus());
        cal.calc(createDirector());
    }
}
